# -*- coding = utf-8 -*-
# @Time : 2021/4/30 14:48
# @Author : 龙王赘婿_彪少
# @File : demo04.py
# @Software: PyCharm

#循环A
#打印 0 1 2 3 4
for i in range(5):
    print(i)
print("\r\n")

#打印 3 4 5 6 7 8 9
for j in range(3,10):
    print(j)
print("\r\n")

for k in range(0,10,3):
    print(k)
print("\r\n")

for l in range(-10,-100,-30):
    print(l)
print("\r\n")

name = "chengdu"

for m in name:
    print(m,end="\t")
print("\n")

a = ["aa","bb","cc","dd"]
for n in range(len(a)):
    print(n,a[n])
print("\n")

i = 0
while i<5:
    print("当前是第%d次循环"%(i+1))
    print("i=%d"%i)
    i += 1
print("\n")

#1-100求和
sum = 0
j = 1
while  j <= 100:
    sum += j
    j+=1
print(sum)

#while else
count = 0
while count < 5:
    print(count,"小于5")
    count += 1
else:
    print(count,"大于等于5")

# break continue pass

i = 0
while i<10:
    i += 1
    print("-"*100)
    print(i)
    if i == 5:
        break

i = 0
while i<10:
    i += 1
    print("-"*100)
    if i == 5:
        continue
    print(i)
